var app=getApp();
// components/search/search.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    isnavigator: {
      type: Boolean,
      value: false
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    
  },

  /**
   * 组件的方法列表
   */
  methods: {
    inputsearchname: function (e) {
      let that = this;
      that.setData({
        searchname: e.detail.value
      })
    },
    search: function () {
      let that = this;
      var search = this.data.searchname;
      var url = "http://" + app.globalData.ipv4 + ":8080/species/findspeciesnameforWx?speciesName=" + search;
      wx.request({
        url: url,
        success: function (e) {
          var myEventDetail = { // detail对象，提供给事件监听函数  //监听函数可以通过e.detail查看传递的数据;
            goods: e.data
          }
          var myEventOption = {
          } // 触发事件的选项
          that.triggerEvent('myevent', myEventDetail, myEventOption);
        }
      })
    },
    setCat:function(e){
      app.globalData.HZL_my_cat = e.HZL_my_cat;
      app.globalData.HZL_num = e.HZL_num;
    }
  }
})
